package com.xintoucloud.gsv.controller;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.xintoucloud.gsv.entity.Dept;
import com.xintoucloud.gsv.entity.User;
import com.xintoucloud.gsv.model.CheckArr;
import com.xintoucloud.gsv.model.MenuRoleVo;
import com.xintoucloud.gsv.model.Status;
import com.xintoucloud.gsv.model.TreeData;
import com.xintoucloud.gsv.model.TreeNode;
import com.xintoucloud.gsv.service.RolePermissionService;
import com.xintoucloud.gsv.service.RoleService;

@Controller
@RequestMapping("/RolePermission")
public class RolePermissionManageController {
	@Autowired
	private RolePermissionService rolePService;
	
	@RequestMapping("/index")
	public String index(int rid,HttpSession session){
		session.setAttribute("editRid", rid);
		return "rolePermissionManage";
	}

	@RequestMapping("/list")
	@ResponseBody
	public TreeData index(HttpSession session){
		int editRid = Integer.parseInt(session.getAttribute("editRid").toString());
		TreeData treeData = rolePService.getTreeData(editRid);
		return treeData;
	}
	

}
